package com.admin.education.models;

import com.admin.education.repositories.Identifiable;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

@Entity
@Table(name = "circles")
@EntityListeners(AuditingEntityListener.class)
@Data
public class Circles  implements Serializable,Identifiable {
    @Column(name = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @Column(name="user_information_id")
    @NotNull
    private long userInformationId;
    @Column(name="title")
    private String title;
    @Column(name="content")
    private String content;
    @Column(name="path")
    private String path;
    @Column(name="create_time")
    private Date createTime;
    @OneToMany(mappedBy = "circles")
    private List<Pictures> pirtures;
    @ManyToMany
    private List<Categorys> categorys;
    @OneToMany(mappedBy = "circles")
    private List<Comments> comments;
    @OneToMany(mappedBy = "circles")
    private List<Admirers> admirers;
}
